Skip to content

refactor(engine,editor): replay + adjustment-editor seam splits, ported to origin - #212

Merged
K-Arthur merged 3 commits into
masterfrom
sync/seam-c-origin-20261030
Oct 31, 2026
Merged

K-Arthur merged 3 commits into
masterfrom
sync/seam-c-origin-20261030

Conversation

@K-Arthur

Copy link
Copy Markdown
Collaborator

Re-cut of the local seam-C refactor batch onto current origin/master: B-11 adjustment editor split, C-01 Canvas2D replay split, and the replay cycle-resolution follow-up. Origin-only differences were folded in (canvas font string, raster tile copy, text-frame paint); local-line-only agent infra files and the C-02 canvas-input split are intentionally excluded (origin already carries a different inputPipeline and no agent-infra files). Verified: engine/editor tsc 0, biome clean, engine cycles at the pre-batch count. Draft for review; C-02 needs a separate re-cut.

@K-Arthur
K-Arthur marked this pull request as ready for review October 31, 2026 04:21
Kevin Arthur added 3 commits October 30, 2026 22:32
…ules (Batch B/B-11)

Pure code motion: the 2,405-line AdjustmentEditor.tsx becomes a 15-line definition shell (same four named exports, dispatcher body verbatim, CSS import once) plus 24 modules under adjustmentEditors/ (every module <=400 lines; largest 322). LegacyAdjustmentEditor (807 lines) is split into a runtime hook (hooks and hueSaturationRange state stay in the base order) plus four plain phase renderers that keep the switch's case bodies verbatim; the nested LutEditor stays nested so its remount semantics are unchanged. HalftoneEditor (446 lines) becomes a hook, a shell with the S1-S5 JSX verbatim, and an unconditionally mounted advanced phase so the disclosure state lifetime is unchanged. BooleanRow, AdjustmentEditorProps, the family editors, the color converters, and the halftone options each get exactly one home; the original path re-exports the moved public names by name.

Proof: refactor-verify --base master --dest .../adjustmentEditors exit 0 {ok:true, baseCount:24, presentCount:33, missing:[], missingExports:[]}; covering suite AdjustmentEditor.test.tsx + AdjustmentPanel.test.tsx 32/32 passed before and after (18/18 direct target, test untouched); direct recursive tsc substitute 22 projects exit 0 with 0 diagnostics; biome clean; audit-health passed; partition proof 2,405 = 50 import-region + 2,307 moved + 23 wrapper + 25 blank lines. Baseline: 0 added, 0 grown, exactly one removed, 945 -> 944; repo map regenerated from the staged tree. No visual surface changed; no e2e/visual/lockfile/manifest/dated-doc changes.
(cherry picked from commit 42207fe)
…/C-01)

Move the 3,898-line Canvas2D IR replay entry into one module per replay
family plus orchestrator phases under packages/engine/src/replay/. The entry
keeps its path and public surface as a 371-line orchestrator: the COMPLEXITY
header, the four per-replay state bindings (now exported for sibling reads),
the 281-line replayIr item pass, the two existing re-export statements and six
explicit re-exports of the moved public names.

Destination modules (all <=400 lines; largest text.ts 370, typography 355,
effect 317, backdrop 312, primitive 290): types, color, isolatedSurface,
primitive (paintShapeFill with its per-kind monomorphic switch, traceOutline,
traceSquirclePath, paintPathFill, TAU), primitiveBounds, effect,
effectDiagnostics, alphaMask, backdrop (shadowOps/alphaStrokeOps, backdrop
blur, glass material), backdropCache, fill, fillImage, fillImageMask, table,
raster, text (paintText dispatch), textRich, textCanonical, textPath,
typography. No dispatch table, no renames, no behavior change.

Proof: extraction script asserted 107/107 block assignment, source tiling
identity and the 400-line cap before writing; independent verifier vs
git show 8082741 reports base statements 107 = after statements 107 + 6
planned re-exports, AST-printer identity missing 0/extra 0, comments 238/238
exact (18 exact-text diffs are biome line-rewrap only); planned edits are
export prefixes and 14 inline import() specifier rebases. refactor-verify
--base master --dest packages/engine/src/replay exits 0 ({ok:true,
baseCount:105,presentCount:105,missing:[],missingExports:[]}) before tests and
after biome.

Covering set unchanged: replay.test.ts 10/10, replay*.test.ts 29 files/224
tests, __goldens__ 3 files/12 tests, before and after, 0 failures; no test
file edited. Direct recursive tsc substitute (20 package tsconfigs +
apps/desktop + tests/e2e): 22 projects/0 failures before and after; engine
tsc 0; biome clean on 21 files; audit-health exit 0; audit:emoji,
audit:committed-imports and the staged commit checkpoint pass.

Batch C benchmark: canonical replay bench before/after 100 and 1,000 rects
plus an extended same-harness 10k/50k measurement (temporary untracked copy,
removed before staging); audit-render-perf --ci before PASS and after two
quiet runs PASS with no performance baseline regeneration (one intermediate
loaded run flagged only the sub-millisecond 100-node panZoom ratio boundary
and was re-verified). Architecture cycle identity delta recorded in
SEAM_SPEC.md (engine madge identities 11 -> 19; the pre-existing
audit-architecture gate was already red from B-05, no allowlist update).

Baseline: added 0, grown 0, removed exactly packages/engine/src/replay.ts,
944 -> 943; report 6,333 scanned / 943 frozen / 0 stale / 0 WIP / 289,430
excess lines. Worktree .worktrees/C-01, branch seam/C/C-01-replay created
from seam/B/B-11-adjustment-editor 9c9da88 and rebased onto local master
39e9be0 (HEAD 8082741); local master was not advanced. No visual surface
changed; front-end gate not triggered and visual validation not required.

(cherry picked from commit 2bf4871)
@K-Arthur
K-Arthur force-pushed the sync/seam-c-origin-20261030 branch from 99fc7ae to a154a2f Compare October 31, 2026 05:32
@K-Arthur
K-Arthur merged commit 4bae34d into master Oct 31, 2026
22 of 23 checks passed
@K-Arthur
K-Arthur deleted the sync/seam-c-origin-20261030 branch October 31, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant